// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import MintUI from 'mint-ui';
import store from './vuex/store';
import FastClick from 'fastclick';
import thousandthSpan from './common/plugins/thousandthSpan';
import {
  storePermission,
  hasPermissions,
  thousandth
} from './common/permission';

import VeeValidate from '@/common/validate.js';

import 'mint-ui/lib/style.css';
import './assets/css/common.scss';

if ('addEventListener' in document) {
  document.addEventListener('DOMContentLoaded', function () {
    FastClick.attach(document.body);
  }, false);
}

Vue.use(MintUI);
Vue.use(VeeValidate);

Vue.config.productionTip = false;

/*Object.keys(filters).forEach(key => { //注册全局filter
  Vue.filter(key, filters[key]);
});*/
Vue.filter('permissions', storePermission);
Vue.filter('hasPermissions', hasPermissions);
Vue.filter('thousandth', thousandth);
Vue.component('tshSpan', thousandthSpan);
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
  /*template: '<App/>',
  components: {App}*/
  components: {
    'tshSpan': thousandthSpan
  }
});
